import React, {useState, useRef} from 'react';
import {View, Text, TouchableOpacity} from 'react-native';
import {Button} from '@rneui/base';
import Popover from 'react-native-popover-view';

export default () => {
  const [showPopover, setShowPopover] = useState(true);
  const sourceRef = useRef();
  return (
    <>
      <Popover
        isVisible={showPopover}
        backgroundStyle={{
          opacity: 0.8,
        }}
        popoverStyle={{
          marginTop: 60,
          width: 200,
          height: 250,
          marginRight: 10,
        }}
        popoverShift={{
          x: 1,
          y: -1
        }}
        onRequestClose={() => setShowPopover(false)}>
        <View
          // style={{
          //   height: 200
          // }}
        >
          <Text>内容</Text>
        </View>
      </Popover>
      <Button
        title="打开V1.0"
        onPress={() => {
          setShowPopover(true);
        }}
      />
    </>
  );
};
